Skip to content

Conversation

pascalconfluent
Copy link
Owner

…ns (modelcontextprotocol#27)

  • The type field and associated methods were redundant in Content implementations (TextContent, ImageContent, EmbeddedResource) as the type information is already handled by Jackson's polymorphic type handling via @JsonSubTypes annotation.
  • Add default implementation that returns the appropriate type string based on the implementing class (text, image, or resource)
  • Added comprehensive unit tests for McpSchema to validate serialization/deserialization behavior of all schema components.
  • Add deserialization tests for all content types
  • Add json-unit-assertj for flexible JSON testing - ignores array order and extra array items, reducing test brittleness while maintaining functional validation.

Resolves modelcontextprotocol#26
Resolve spring-projects/spring-ai#2350

…ns (#27)

- The type field and associated methods were redundant in Content implementations (TextContent, ImageContent, EmbeddedResource)
  as the type information is already handled by Jackson's polymorphic type handling via @JsonSubTypes annotation.
- Add default implementation that returns the appropriate type string based on the implementing class (text, image, or resource)
- Added comprehensive unit tests for McpSchema to validate serialization/deserialization behavior of all schema components.
- Add deserialization tests for all content types
- Add json-unit-assertj for flexible JSON testing -  ignores array order and extra array items, reducing test brittleness while
maintaining functional validation.

Resolves #26
Resolve spring-projects/spring-ai#2350

Signed-off-by: Christian Tzolov <[email protected]>
@pascalconfluent pascalconfluent merged commit 600f10e into pascalconfluent:main Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve MchSchema JSON consistency Duplicate "type" field in JSON output of McpSchema.TextContent

2 participants